package com.weirn.springmvc.Controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by yp-tc-2563 on 2017/10/18.
 */
public class HelloWorldController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request
            , HttpServletResponse response) throws Exception {
        System.out.println ("HelloWorldController.handleRequest");

        ModelAndView modelAndView = new ModelAndView (  );
        modelAndView.addObject ( "message","Hello World" );
        modelAndView.setViewName ( "hello" );

        return modelAndView;
    }
}
